From ac33847b3005dab85bc8e5792188713b973c4b1e Mon Sep 17 00:00:00 2001 From: t895 Date: Fri, 16 Feb 2024 21:11:47 -0500 Subject: hid_core: Prevent crash if we try to iterate through empty color devices list --- src/hid_core/frontend/emulated_controller.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp index b4b6fa7c8..8b5d0eec6 100644 --- a/src/hid_core/frontend/emulated_controller.cpp +++ b/src/hid_core/frontend/emulated_controller.cpp @@ -581,6 +581,9 @@ void EmulatedController::DisableConfiguration() { // Get Joycon colors before turning on the controller for (const auto& color_device : color_devices) { + if (color_device == nullptr) { + continue; + } color_device->ForceUpdate(); } -- cgit v1.2.3